<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<link rel="stylesheet" href="改.css">
  
    <script>
        // 计算现在时间距离 2022年6月27号9:00 时间差 显示页面上，实时倒计时。
          
    
       
        var startTime = new Date();

console.log(startTime)

var endTime = new Date('2022-6-27 9:00:00');



var td = parseInt( (endTime.getTime() - startTime.getTime()) / 1000 ) ;

// console.log( td );




      var d = parseInt( td / (24*60*60) );



      var h = parseInt( td % (24*60*60) / (60*60) );


      var m = parseInt( td % (60*60) / 60 );


      var s = td % 60 ;



     document.write( `距离恐怖之夜27日还有  ${d < 10 ? '0' + d : d}天${h < 10 ? '0' + h : h}小时${m < 10 ? '0' + m : m}分${s < 10 ? '0' + s : s}秒` );  



    </script>
</body>
</html>

